# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python-translate
_pkgname=translate
pkgver=3.6.1
pkgrel=5
pkgdesc='Command line translator with google translate behind it.'
arch=('any')
url='https://pypi.org/project/translate/#files'
license=('MIT')
depends=('python' 'python-click' 'python-lxml' 'python-requests'
         'python-libretranslatepy')
makedepends=('python-build' 'python-pip' 'python-wheel')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('cfc9faf1a8b12eb3fce04066f7aece3330f786ab900cb211fbcb1cd469ae5f6483d25cd6f4e54227c72e17bbd4146c85f6f0a852a3dae0964f833076419bd7b0')

build() {
  cd "$_pkgname-$pkgver"

  python -m build --wheel --outdir="$startdir/dist"
}

package() {
  cd "$_pkgname-$pkgver"

  pip install \
    --verbose \
    --disable-pip-version-check \
    --no-warn-script-location \
    --ignore-installed \
    --no-compile \
    --no-deps \
    --root="$pkgdir" \
    --prefix=/usr \
    --no-index \
    --find-links="file://$startdir/dist" \
    $_pkgname
}

